#include<stdio.h>
int main()
{
	int a;
	int max=0,min=0;
	while(scanf("%d",&a)!=EOF)
	{
		if(a%2==0&&a<32768)
		{
		int x=a%4;
		if(x==0)
		{
			min=a/4;
		}
		else
		{
			min=x/4+x%4/2;
		}
		max=a/2;
		printf("%d %d\n",min,max);
     	}
     	else
     	{
     		printf("0 0");
     		printf("\n");
		 }
	}
	return 0;
}
